﻿<%@ Page Language="C#" AutoEventWireup="true" EnableViewState="false" EnableEventValidation="false" CodeBehind="SafeInventoryRptList.aspx.cs"
    Inherits="WMS6.Web.Analytics.SafeInventoryRptList" meta:resourcekey="Page" %>

<%@ PreviousPageType VirtualPath="~/Analytics/SafeInventoryRptQuery.aspx" %>
<%@ Register Src="../UserControls/Pager.ascx" TagName="Pager" TagPrefix="uc1" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title>SafeInventoryRptList</title>
    <link href="../style/zh/1/css.css" type="text/css" rel="Stylesheet" id="mycss" />
    <link href="../Css/style.css" type="text/css" rel="stylesheet" />

    <script src="../Js/jquery.js" type="text/javascript"></script>

    <script src="../Js/jquery.simplemodal.js" type="text/javascript"></script>

    <script src="../Js/util.js" type="text/javascript"></script>

    <script src="../Js/InitPage.js" type="text/javascript"></script>

    <script src="../Js/checkbox.js" type="text/javascript"></script>

    <script type="text/javascript">
    
      window.onload = function(){
            initListPage();
        }
        
        function returnSearch()
        {
            var from = document.getElementById("hdnFrom").value;
            if(from != "")
            {
                window.location.href = "SafeInventoryRptQuery.aspx";
            }
            else
            {
                window.history.go(-1);
            }
        }
    </script>

</head>
<body>
    <form id="F15271" runat="server">
    <div>
        <asp:ScriptManager ID="ScriptManager1" runat="server" />
        <div id="div_List_top">
            <table>
                <tr>
                    <td valign="bottom">
                        <asp:Label ID="lblReceiptInquiryList" runat="server" CssClass="label_header" Text="安全库存报告"
                            meta:resourcekey="lblReceiptInquiryList"></asp:Label>
                    </td>
                    <td>
                        <asp:Button ID="btnRefresh" runat="server" CssClass="button" Enabled="False" Text="<%$ Resources:ButtonResource,btnRefresh %>"
                            OnClick="btnRefresh_Click" meta:resourcekey="btnRefresh" />
                    </td>
                </tr>
            </table>
        </div>
        <div class="blank8">
        </div>
        <asp:UpdatePanel ID="up1" runat="server">
            <ContentTemplate>
                <div id="div_List">
                    <div id="div_List_msg">
                        <asp:Label ID="lblMsg" runat="server" CssClass="label_message" meta:resourcekey="lblMsg"></asp:Label>
                    </div>
                    <asp:GridView ID="gvSafeInventory" runat="server" AutoGenerateColumns="False" AllowSorting="True"
                        CssClass="gridview" DataKeyNames="OWNER_ID" PageSize="20" Width="2100px" OnRowDataBound="gvSafeInventory_RowDataBound"
                        OnInit="gvSafeInventory_Init" OnSorting="gvSafeInventory_Sorting" meta:resourcekey="gvSafeInventory">
                        <FooterStyle CssClass="GridViewFooterStyle" />
                        <RowStyle CssClass="GridViewRowStyle" />
                        <HeaderStyle CssClass="GridViewHeaderStyle" />
                        <AlternatingRowStyle CssClass="GridViewAlternatingRowStyle" />
                        <Columns>
                            <asp:BoundField HeaderText="序号" FooterText="序号" meta:resourcekey="FieldSN">
                                <ItemStyle CssClass="GridViewRowWidth_40" />
                            </asp:BoundField>
                            <asp:TemplateField meta:resourcekey="TemplateField">
                                <HeaderTemplate>
                                    <img src="../Images/gvSettingpic.gif" id="img01" class="gvSettingImg" onclick="gvUserSetting('15271','gvSafeInventory');"
                                        onmouseover="showGVUserSettingAlt(this);" alt="customize list" />
                                    <asp:CheckBox ID="CheckBox1" runat="server" onclick="selectAll(this,'gvSafeInventory');"
                                        meta:resourcekey="CheckBox1" />
                                </HeaderTemplate>
                                <ItemTemplate>
                                    <asp:CheckBox ID="chbSelect" runat="server" meta:resourcekey="chbSelect" />
                                </ItemTemplate>
                                <FooterTemplate>
                                    <asp:CheckBox ID="CheckBox2" runat="server" onclick="selectAll(this,'gvSafeInventory');"
                                        meta:resourcekey="CheckBox2" />
                                </FooterTemplate>
                                <HeaderStyle HorizontalAlign="Center" CssClass="GridViewRowWidth_50" />
                                <ItemStyle HorizontalAlign="Center" CssClass="GridViewRowWidth_50" />
                            </asp:TemplateField>
                            <asp:BoundField DataField="OWNER_ID" HeaderText="货主代码" FooterText="货主代码" SortExpression="OWNER_ID"
                                meta:resourcekey="FieldOwner">
                                <ItemStyle CssClass="GridViewRowWidth_100" />
                            </asp:BoundField>
                            <asp:BoundField DataField="VENDOR_ID" HeaderText="供应商代码" FooterText="供应商代码" SortExpression="VENDOR_ID"
                                meta:resourcekey="VENDOR_ID">
                                <ItemStyle CssClass="GridViewRowWidth_100" />
                            </asp:BoundField>
                            <asp:BoundField DataField="SKU_ID" HeaderText="货品代码" FooterText="货品代码" SortExpression="SKU_ID"
                                meta:resourcekey="FieldSkuID">
                                <ItemStyle CssClass="GridViewRowWidth_100" />
                            </asp:BoundField>
                            <asp:BoundField DataField="PACK_ID" HeaderText="包装代码" FooterText="包装代码" SortExpression="PACK_ID"
                                meta:resourcekey="PACK_ID">
                                <ItemStyle CssClass="GridViewRowWidth_100" />
                            </asp:BoundField>
                            <asp:BoundField DataField="UOM_DESCR" HeaderText="单位" FooterText="单位" SortExpression="UOM_DESCR"
                                meta:resourcekey="UOM_DESCR">
                                <ItemStyle CssClass="GridViewRowWidth_100" />
                            </asp:BoundField>
                            <asp:TemplateField FooterText="描述" HeaderText="描述" SortExpression="DESCR" meta:resourcekey="FieldSkuID">
                                <ItemTemplate>
                                    <asp:Label ID="lblSkuDescr" runat="server" Text='<%# Eval("DESCR").ToString() %>'
                                        meta:resourcekey="lblSkuDescr"></asp:Label>
                                </ItemTemplate>
                                <ItemStyle CssClass="GridViewRowWidth_200" />
                            </asp:TemplateField>
                            <asp:TemplateField HeaderText="状态" FooterText="状态" 
                                meta:resourcekey="Status">
                                <ItemTemplate>
                                    <asp:Image ID="imgPriority" runat="server" 
                                        meta:resourcekey="imgPriorityResource1" />
                                </ItemTemplate>
                                <ItemStyle CssClass="GridViewRowWidth_50" HorizontalAlign="Center" />
                            </asp:TemplateField>
                            <asp:TemplateField FooterText="再订货点" HeaderText="再订货点" SortExpression="REORDER_POINT"
                                meta:resourcekey="FieldReorderPoint">
                                <ItemTemplate>
                                    <asp:Label ID="lblReorderPoint" runat="server" Text='<%# GetPreferenceDigit(Eval("REORDER_POINT").ToString()) %>'
                                        meta:resourcekey="lblReorderPoint"></asp:Label>
                                </ItemTemplate>
                                <ItemStyle CssClass="GridViewRowWidth_100" />
                            </asp:TemplateField>
                            <asp:TemplateField FooterText="最小库存" HeaderText="最小库存" SortExpression="MIN_QTY" meta:resourcekey="FieldMinQty">
                                <ItemTemplate>
                                    <asp:Label ID="lblMinQty" runat="server" Text='<%# GetPreferenceDigit(Eval("MIN_QTY").ToString()) %>'
                                        meta:resourcekey="lblMinQty"></asp:Label>
                                </ItemTemplate>
                                <ItemStyle CssClass="GridViewRowWidth_100" />
                            </asp:TemplateField>
                            <asp:TemplateField FooterText="最大库存" HeaderText="最大库存" SortExpression="MAX_QTY" meta:resourcekey="FieldMaxQty">
                                <ItemTemplate>
                                    <asp:Label ID="lblMaxQty" runat="server" Text='<%# GetPreferenceDigit(Eval("MAX_QTY").ToString()) %>'
                                        meta:resourcekey="lblMaxQty"></asp:Label>
                                </ItemTemplate>
                                <ItemStyle CssClass="GridViewRowWidth_100" />
                            </asp:TemplateField>
                            <asp:TemplateField FooterText="库存量" HeaderText="库存量" SortExpression="QTY" meta:resourcekey="FieldQty">
                                <ItemTemplate>
                                    <asp:Label ID="lblQTY" runat="server" Text='<%# GetPreferenceDigit(Eval("QTY").ToString()) %>'
                                        meta:resourcekey="lblQTY"></asp:Label>
                                </ItemTemplate>
                                <ItemStyle CssClass="GridViewRowWidth_100" />
                            </asp:TemplateField>
                            <asp:TemplateField FooterText="预分配数量" HeaderText="预分配数量" SortExpression="PREALLOCATED_QTY"
                                meta:resourcekey="FieldPreallocatedQty">
                                <ItemTemplate>
                                    <asp:Label ID="lblPreallocatedQty" runat="server" Text='<%# GetPreferenceDigit(Eval("PREALLOCATED_QTY").ToString()) %>'
                                        meta:resourcekey="lblPreallocatedQty"></asp:Label>
                                </ItemTemplate>
                                <ItemStyle CssClass="GridViewRowWidth_150" />
                            </asp:TemplateField>
                            <asp:TemplateField FooterText="可用库存" HeaderText="可用库存" SortExpression="AVAILABLE_QTY"
                                meta:resourcekey="FieldAvailableQty">
                                <ItemTemplate>
                                    <asp:Label ID="lblAvailableQty" runat="server" Text='<%# GetPreferenceDigit(Eval("AVAILABLE_QTY").ToString()) %>'
                                        meta:resourcekey="lblAvailableQty"></asp:Label>
                                </ItemTemplate>
                                <ItemStyle CssClass="GridViewRowWidth_100" />
                            </asp:TemplateField>
                            <asp:TemplateField FooterText="最后入库日期" HeaderText="最后入库日期" SortExpression="LAST_RECEIPT_DATE"
                                meta:resourcekey="LAST_RECEIPT_DATE">
                                <ItemTemplate>
                                    <asp:Label ID="lblLAST_RECEIPT_DATE" runat="server" Text='<%# GetPreferenceShortDate(Eval("LAST_RECEIPT_DATE").ToString()) %>'
                                        meta:resourcekey="lblLAST_RECEIPT_DATE"></asp:Label>
                                </ItemTemplate>
                                <ItemStyle CssClass="GridViewRowWidth_150" />
                            </asp:TemplateField>
                            <asp:BoundField HeaderText="至今的天数" FooterText="至今的天数" DataField="LAST_DAYS" SortExpression="LAST_DAYS"
                                meta:resourcekey="LAST_DAYS">
                                <ItemStyle CssClass="GridViewRowWidth_150" />
                            </asp:BoundField>
                            <asp:TemplateField FooterText="库龄<30天" HeaderText="库龄<30天" SortExpression="DAYS_1" meta:resourcekey="DAYS_1">
                                <ItemTemplate>
                                    <asp:Label ID="lblDAYS_1" runat="server" Text='<%# GetPreferenceDigit(Eval("DAYS_1").ToString()) %>'
                                        meta:resourcekey="lblDAYS_1"></asp:Label>
                                </ItemTemplate>
                                <ItemStyle CssClass="GridViewRowWidth_100" />
                            </asp:TemplateField>
                            <asp:TemplateField FooterText="库龄>30天" HeaderText="库龄>30天" SortExpression="DAYS_30" meta:resourcekey="DAYS_30">
                                <ItemTemplate>
                                    <asp:Label ID="lblDAYS_30" runat="server" Text='<%# GetPreferenceDigit(Eval("DAYS_30").ToString()) %>'
                                        meta:resourcekey="lblDAYS_30"></asp:Label>
                                </ItemTemplate>
                                <ItemStyle CssClass="GridViewRowWidth_100" />
                            </asp:TemplateField>
                            <asp:TemplateField FooterText="库龄>60天" HeaderText="库龄>60天" SortExpression="DAYS_60" meta:resourcekey="DAYS_60">
                                <ItemTemplate>
                                    <asp:Label ID="lblDAYS_60" runat="server" Text='<%# GetPreferenceDigit(Eval("DAYS_60").ToString()) %>'
                                        meta:resourcekey="lblDAYS_60"></asp:Label>
                                </ItemTemplate>
                                <ItemStyle CssClass="GridViewRowWidth_100" />
                            </asp:TemplateField>
                            <asp:TemplateField FooterText="库龄>90天" HeaderText="库龄>90天" SortExpression="DAYS_90" meta:resourcekey="DAYS_90">
                                <ItemTemplate>
                                    <asp:Label ID="lblDAYS_90" runat="server" Text='<%# GetPreferenceDigit(Eval("DAYS_90").ToString()) %>'
                                        meta:resourcekey="lblDAYS_90"></asp:Label>
                                </ItemTemplate>
                                <ItemStyle CssClass="GridViewRowWidth_100" />
                            </asp:TemplateField>
                            <asp:TemplateField FooterText="库龄>120天" HeaderText="库龄>120天" SortExpression="DAYS_120" meta:resourcekey="DAYS_120">
                                <ItemTemplate>
                                    <asp:Label ID="lblDAYS_120" runat="server" Text='<%# GetPreferenceDigit(Eval("DAYS_120").ToString()) %>'
                                        meta:resourcekey="lblDAYS_120"></asp:Label>
                                </ItemTemplate>
                                <ItemStyle CssClass="GridViewRowWidth_100" />
                            </asp:TemplateField>
                        </Columns>
                    </asp:GridView>
                    <div>
                        <table width="100%" border="0" cellspacing="0" cellpadding="0">
                            <tr style="height: 10px">
                                <td>
                                </td>
                            </tr>
                            <tr>
                                <td class="Result_01">
                                    总计：
                                </td>
                                <td class="Result_02">
                                    <table>
                                        <tr>
                                            <td style="margin-right: 20px;">
                                                &nbsp; &nbsp;
                                            </td>
                                            <td>
                                                <asp:Label ID="lblTotalReorderPoint" runat="server" Text="再订货点:" class="label" 
                                                    meta:resourcekey="lblTotalReorderPointResource1"></asp:Label>
                                                <asp:Label ID="lblTotalReorderPointText" runat="server" class="label" 
                                                    Style="margin-right: 10px;" 
                                                    meta:resourcekey="lblTotalReorderPointTextResource1"></asp:Label>
                                            </td>
                                            <td>
                                                <asp:Label ID="lblTotalMin" runat="server" Text="最小库存:" class="label" 
                                                    meta:resourcekey="lblTotalMinResource1"></asp:Label><asp:Label
                                                    ID="lblTotalMinQty" runat="server" class="label" 
                                                    Style="margin-right: 10px;" meta:resourcekey="lblTotalMinQtyResource1"></asp:Label>
                                            </td>
                                            <td>
                                                <asp:Label ID="lblTotalMax" runat="server" Text="最大库存:" class="label" 
                                                    meta:resourcekey="lblTotalMaxResource1"></asp:Label>
                                                <asp:Label ID="lblTotalMaxQty" runat="server" class="label" 
                                                    Style="margin-right: 10px;" meta:resourcekey="lblTotalMaxQtyResource1"></asp:Label>
                                            </td>
                                            <td>
                                                <asp:Label ID="lblTotalQty" runat="server" Text="库存量:" class="label" 
                                                    meta:resourcekey="lblTotalQtyResource1"></asp:Label><asp:Label
                                                    ID="lblTotalQtyText" runat="server" class="label" 
                                                    Style="margin-right: 10px;" meta:resourcekey="lblTotalQtyTextResource1"></asp:Label>
                                            </td>
                                            <td>
                                                <asp:Label ID="lblTotalPreallocated" runat="server" Text="预分配数量:" class="label" 
                                                    meta:resourcekey="lblTotalPreallocatedResource1"></asp:Label><asp:Label
                                                    ID="lblTotalPreallocatedQty" runat="server" class="label" 
                                                    Style="margin-right: 10px;" meta:resourcekey="lblTotalPreallocatedQtyResource1"></asp:Label>
                                            </td>
                                            <td>
                                                <asp:Label ID="lblTotalAvailable" runat="server" Text="可用库存:" class="label" 
                                                    meta:resourcekey="lblTotalAvailableResource1"></asp:Label><asp:Label
                                                    ID="lblTotalAvailableQty" runat="server" class="label" 
                                                    Style="margin-right: 10px;" meta:resourcekey="lblTotalAvailableQtyResource1"></asp:Label>
                                            </td>
                                        </tr>
                                    </table>
                                </td>
                                <td class="Result_03">
                                </td>
                            </tr>
                            <tr style="height: 20px">
                                <td>
                                </td>
                            </tr>
                        </table>
                    </div>
                </div>
                <div id="div_pager">
                    <uc1:Pager ID="PagerFooter" runat="server" OnFirst="btnFirst_Click" OnPrevious="btnPrevious_Click"
                        OnNext="btnNext_Click" OnLast="btnLast_Click" OnGoTo="GoTo_Click" />
                </div>
                <input type="hidden" runat="server" id="hdnFrom" />
            </ContentTemplate>
        </asp:UpdatePanel>
        <input type="hidden" id="hdnActionID" runat="server" />
        <div id="div_List_bottom">
            <table>
                <tr>
                    <td>
                        <asp:Button ID="btnSearch" runat="server" Text="<%$ Resources:ButtonResource,btnNewSearch %>"
                            CssClass="button" Enabled="False" OnClientClick="javascript:window.location.href='SafeInventoryRptQuery.aspx';return false;"
                            meta:resourcekey="btnSearch" />
                    </td>
                    <td>
                        <asp:Button ID="btnReSearch" runat="server" Text="<%$ Resources:ButtonResource,btnReSearch %>"
                            CssClass="button" Enabled="False" OnClientClick="javascript:returnSearch();return false;"
                            meta:resourcekey="btnReSearch" />
                    </td>
                    <td>
                        <asp:Button ID="btnList" runat="server" Text="<%$ Resources:ButtonResource,btnList %>"
                            CssClass="button" Enabled="False" OnClick="btnList_Click" meta:resourcekey="btnList" />
                    </td>
                    <td>
                        <asp:Button ID="btnExport" runat="server" Text="<%$ Resources:ButtonResource,btnExport %>"
                            CssClass="button" Enabled="False" OnClick="btnExport_Click" meta:resourcekey="btnExport" />
                    </td>
                </tr>
            </table>
        </div>
    </div>
    </form>
</body>
</html>
